package error.虚拟机栈和本地方法栈溢出;

public class MxOutOfMemory {

    private void dontStop() {
        while (true) {

        }
    }

    public void stackLeakByThread() {
        while (true) {
            new Thread(() -> {
                dontStop();
            }).start();
        }
    }

    public static void main(String[] args) {
        MxOutOfMemory m = new MxOutOfMemory();
        m.stackLeakByThread();
    }
}
